﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using DomainDriver.DomainModeling.GenericUnitTesting;
using AutomotivePricingModel.Vehicles;

namespace AutomotivePricingModel.UnitTests.DomainObjects
{
    [TestFixture]
    public class VehicleTests : DomainObjectTestFixture<Guid, Vehicle>
    {
        protected override Vehicle CreateUniqueDomainObject()
        {
            return new Vehicle();
        }

        protected override ICollection<DomainObjectModifier<Guid, Vehicle>> GetDomainObjectModifiers()
        {
            List<DomainObjectModifier<Guid, Vehicle>> modifiers = new List<DomainObjectModifier<Guid, Vehicle>>();
            modifiers.Add((Vehicle domainObject) => domainObject.ModelYear = m_IntUpdateValue);
            modifiers.Add((Vehicle domainObject) => domainObject.ModelYear = null);
            modifiers.Add((Vehicle domainObject) => domainObject.OptionsConfiguration.BodyStyle++);
            modifiers.Add((Vehicle domainObject) => domainObject.OptionsConfiguration.DriveTrainType++);
            modifiers.Add((Vehicle domainObject) => domainObject.OptionsConfiguration.EngineSizeInLiters = m_DoubleUpdateValue);
            modifiers.Add((Vehicle domainObject) => domainObject.OptionsConfiguration.HasNavigationSystem = !domainObject.OptionsConfiguration.HasNavigationSystem);
            modifiers.Add((Vehicle domainObject) => domainObject.OptionsConfiguration.NumberOfCylinders = m_IntUpdateValue);
            modifiers.Add((Vehicle domainObject) => domainObject.OptionsConfiguration.NumberOfSpeeds = m_IntUpdateValue);
            modifiers.Add((Vehicle domainObject) => domainObject.OptionsConfiguration.TransmissionType++);
            modifiers.Add((Vehicle domainObject) => domainObject.ParentProductionModel = m_GuidUpdateValue);
            modifiers.Add((Vehicle domainObject) => domainObject.ParentProductionModel = null);
            modifiers.Add((Vehicle domainObject) => domainObject.PriceHistory.SetValue(m_IntUpdateValue, m_DoubleUpdateValue));
            modifiers.Add((Vehicle domainObject) => domainObject.PriceHistory.SetValue(m_IntUpdateValue2, m_DoubleUpdateValue2));
            modifiers.Add((Vehicle domainObject) => domainObject.PriceHistory.RemoveValue(m_IntUpdateValue));
            modifiers.Add((Vehicle domainObject) => domainObject.PriceHistory.SetValue(m_IntUpdateValue3, m_DoubleUpdateValue3));
            modifiers.Add((Vehicle domainObject) => domainObject.PriceHistory.RemoveValue(m_IntUpdateValue3));
            modifiers.Add((Vehicle domainObject) => domainObject.PriceHistory.RemoveValue(m_IntUpdateValue2));
            return modifiers;
        }

        [Test]
        public override void VerifyDomainObjectFunctionality()
        {
            base.VerifyDomainObjectFunctionality();
        }
    }
}